<template >
    <div class="modal-w">
        <!-- 正常 -->
        <div class="titicon" v-if="areaflag=='正常'">
            <img class="ticon" src='@/assets/titicon.png' />
            运行状态：
            <span class="status">{{areaflag}}</span>
        </div>
        <!-- 预警 -->
        <div class="titicon" v-else-if="areaflag=='预警'">
            <img class="ticon" src='@/assets/titicon_warn.png' />
            运行状态：
            <span class="status" style="color:#FFCB00">{{areaflag}}</span>
        </div>
        <!-- 其他 -->
        <div class="titicon" v-else>
            <img class="ticon" src='@/assets/titicon.png' />
            运行状态：
            <span class="status">{{areaflag}}</span>
        </div>
        <div class="shortline"></div>
        <div class="longline"></div>
        <div class="head">
            <div class="headitem left">
                <div class="titleinfo">
                    <img src="@/assets/shuangyuan.png" class="basetitle" alt="icon" />
                    <span class="title">今日体征</span>
                    <span class="value">{{ ctcount.num||ctcount }}</span>
                    <span class="unit">项</span>
                    <img src='@/assets/santiao.png' class="santiao" alt="icon" />
                </div>
            </div>
            <div class="headitem">
                <div class="titleinfo" style="margin-left:230px">
                    <img src="@/assets/shuangyuan.png" class="basetitle" alt="icon" />
                    <span class="title">体征发现</span>
                    <span class="value">{{ tzcount }}</span>
                    <span class="unit">条</span>
                    <img src='@/assets/santiao.png' class="santiao" alt="icon" />
                </div>
            </div>
        </div>
        <div class="content">
            <div class="left">
                <div class="left-l">
                    <div class="iconcontent">
                        <!-- 74 * 84 总宽度84 -->
                        <div class="menuicon" @click="selectMenu('chengshizhisheng')">
                            <img src="@/assets/icon11.png" class="base" alt="icon" v-if="menuitem != 'chengshizhisheng'" />
                            <img src="@/assets/icon12.png" class="base" alt="icon" v-if="menuitem == 'chengshizhisheng'" />
                            <img src="@/assets/icon8.png" class="iconx" alt="icon" />
                            <img src="@/assets/arrow_left.png" class="arrow-left" alt="icon" v-if="menuitem == 'chengshizhisheng'" />
                            <img src="@/assets/arrow_right.png" class="arrow-right" alt="icon" v-if="menuitem == 'chengshizhisheng'" />
                            <div v-if="menuitem !== 'chengshizhisheng'">
                                <div class="menuicontitle">城市之声</div>
                            </div>
                            <div v-if="menuitem == 'chengshizhisheng'">
                                <div class="menuicontitlea">城市之声</div>
                            </div>
                        </div>
                        <div class="menuicon" @click="selectMenu('chengshizhigan')">
                            <img src="@/assets/icon11.png" class="base" alt="icon" v-if="menuitem != 'chengshizhigan'" />
                            <img src="@/assets/icon12.png" class="base" alt="icon" v-if="menuitem == 'chengshizhigan'" />
                            <img src="@/assets/icon6.png" class="iconx" alt="icon" />
                            <div v-if="menuitem !== 'chengshizhigan'">
                                <div class="menuicontitle">城市之感</div>
                            </div>
                            <div v-if="menuitem == 'chengshizhigan'">
                                <div class="menuicontitlea">城市之感</div>
                            </div>
                            <img src="@/assets/arrow_left.png" class="arrow-left" alt="icon" v-if="menuitem == 'chengshizhigan'" />
                            <img src="@/assets/arrow_right.png" class="arrow-right" alt="icon" v-if="menuitem == 'chengshizhigan'" />
                        </div>
                        <div class="menuicon" @click="selectMenu('chengshizhiyan')">
                            <img src="@/assets/icon11.png" class="base" alt="icon" v-if="menuitem != 'chengshizhiyan'" />
                            <img src="@/assets/icon12.png" class="base" alt="icon" v-if="menuitem == 'chengshizhiyan'" />
                            <img src="@/assets/icon10.png" class="iconx" alt="icon" />
                            <div v-if="menuitem !== 'chengshizhiyan'">
                                <div class="menuicontitle">城市之眼</div>
                            </div>
                            <div v-if="menuitem == 'chengshizhiyan'">
                                <div class="menuicontitlea">城市之眼</div>
                            </div>
                            <img src="@/assets/arrow_left.png" class="arrow-left" alt="icon" v-if="menuitem == 'chengshizhiyan'" />
                            <img src="@/assets/arrow_right.png" class="arrow-right" alt="icon" v-if="menuitem == 'chengshizhiyan'" />
                        </div>
                        <div class="menuicon" @click="selectMenu('chengshihuxi')">
                            <img src="@/assets/icon11.png" class="base" alt="icon" v-if="menuitem != 'chengshihuxi'" />
                            <img src="@/assets/icon12.png" class="base" alt="icon" v-if="menuitem == 'chengshihuxi'" />
                            <img src="@/assets/icon2.png" class="iconx" alt="icon" />
                            <div v-if="menuitem !== 'chengshihuxi'">
                                <div class="menuicontitle">城市呼吸</div>
                            </div>
                            <div v-if="menuitem == 'chengshihuxi'">
                                <div class="menuicontitlea">城市呼吸</div>
                            </div>
                            <img src="@/assets/arrow_left.png" class="arrow-left" alt="icon" v-if="menuitem == 'chengshihuxi'" />
                            <img src="@/assets/arrow_right.png" class="arrow-right" alt="icon" v-if="menuitem == 'chengshihuxi'" />
                        </div>
                        <div class="menuicon" @click="selectMenu('chengshiwendu')">
                            <img src="@/assets/icon11.png" class="base" alt="icon" v-if="menuitem != 'chengshiwendu'" />
                            <img src="@/assets/icon12.png" class="base" alt="icon" v-if="menuitem == 'chengshiwendu'" />
                            <img id='imgWenDu' src="@/assets/wendu.png" class="iconx" alt="icon" />
                            <div v-if="menuitem !== 'chengshiwendu'">
                                <div class="menuicontitle">城市温度</div>
                            </div>
                            <div v-if="menuitem == 'chengshiwendu'">
                                <div class="menuicontitlea">城市温度</div>
                            </div>
                            <img src="@/assets/arrow_left.png" class="arrow-left" alt="icon" v-if="menuitem == 'chengshiwendu'" />
                            <img src="@/assets/arrow_right.png" class="arrow-right" alt="icon" v-if="menuitem == 'chengshiwendu'" />
                        </div>
                        <div class="menuicon" @click="selectMenu('chengshimaibo')">
                            <img src="@/assets/icon11.png" class="base" alt="icon" v-if="menuitem != 'chengshimaibo'" />
                            <img src="@/assets/icon12.png" class="base" alt="icon" v-if="menuitem == 'chengshimaibo'" />
                            <img src="@/assets/icon4.png" class="iconx" alt="icon" />
                            <div v-if="menuitem !== 'chengshimaibo'">
                                <div class="menuicontitle">城市脉搏</div>
                            </div>
                            <div v-if="menuitem == 'chengshimaibo'">
                                <div class="menuicontitlea">城市脉搏</div>
                            </div>
                            <img src="@/assets/arrow_left.png" class="arrow-left" alt="icon" v-if="menuitem == 'chengshimaibo'" />
                            <img src="@/assets/arrow_right.png" class="arrow-right" alt="icon" v-if="menuitem == 'chengshimaibo'" />
                        </div>
                    </div>
                </div>
                <div class="left-r">
                    <slot name="changtai" :menuitem="menuitem"></slot>
                </div>
            </div>
            <div class="right">
                <div class="right-t">
                    <slot name="pie"></slot>
                </div>
                <div class="right-b">
                    <slot name="form"></slot>
                </div>
            </div>
        </div>
    </div>
</template>
<script lang="ts">
import pie from '@/components/pie.vue'
import forms from './forms.vue'
import '../font/fzzym/Fzz.css'
import { ref, reactive } from 'vue'
export default {
    props: {
        tzcount: Number,
        ctcount: Object,
        areaflag: String,
    },
    components: {
        pie,
        forms,
    },
    setup(props) {
        let dataitems = reactive([
            {
                name: '主动',
                value: 15,
                unit: '条',
            },
            {
                name: '被动',
                value: 232,
                unit: '条',
            },
        ])
        const fromsData: any = [
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 1,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 2,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 3,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 1,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 2,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 3,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 1,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 2,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 3,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 1,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 2,
            },
            {
                time: '2021/5/16',
                text: '违法堆物品违法堆物品',
                address: '云舫小区云舫小区云舫小区云舫小区',
                state: 3,
            },
        ]

        // menu 管理
        let menuitem = ref('chengshizhisheng')

        // 切换图标事件
        let selectMenu = (itemname) => {
            menuitem.value = itemname
            // provide('itemname', itemname)
        }

        return {
            dataitems,
            fromsData: reactive(fromsData),
            selectMenu,
            menuitem,
        }
    },
}
</script>
<style lang="less" scoped>
.modal-w {
    border-radius: 10px;
    width: 1000px;
    height: 600px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    padding-left: 20px;
    padding-right: 20px;
    background-color: #011115;
    position: relative;

    * {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }
    .shortline {
        position: absolute;
        right: 0px;
        top: 67px;
        background: url('../assets/lined.png') no-repeat;
        background-size: cover;
        width: 454px;
        height: 10px;
    }
    .longline {
        position: absolute;
        left: 0px;
        top: 68px;
        background: url('../assets/linec.png') no-repeat;
        background-size: cover;
        width: 552px;
        height: 10px;
    }
    .titicon {
        position: absolute;
        font-size: 24px;
        font-family: 'Fzzym';
        font-weight: 400;
        text-align: left;
        color: #ffffff;
        letter-spacing: 2px;
        left: 50%;
        transform: translateX(-50%);
        padding: 0px;
        display: flex;
        line-height: 70px;

        .ticon {
            margin-top: 17px;
            width: 30px;
            height: 30px;
            margin-left: 12px;
            margin-right: 12px;
        }
        .status {
            font-weight: 400;
            color: #00ff36;
            letter-spacing: 2px;
            // text-shadow: 0px 0px 14px #00ff36;
        }
    }
}

.head {
    height: 70px;
    // border-bottom: 2px dashed rgba(7, 48, 74, 0.47);

    .headitem {
        width: 50%;
        height: 100%;
        float: left;
        padding-left: 20px;
        /*border: 1px dashed green;*/
        position: relative;
        .basetitle {
            margin-bottom: 5px;
            margin-right: 12px;
        }
        .titleinfo {
            height: 40px;
            /*line-height: 40px;*/
            // border: 1px solid red;
            display: flex;
            align-items: flex-end;
            position: absolute;
            top: 22px;
            .title {
                font-family: 'Fzzym';
                font-size: 20px;
                font-weight: 400;
                color: #ffffff;
            }

            .value {
                font-size: 20px;
                color: #13f2f1;
                margin-left: 10px;
                line-height: 26px;
            }

            .unit {
                font-size: 20px;
                color: #ccc;
                margin-left: 10px;
                line-height: 26px;
                font-family: 'Fzzym';
            }
            .santiao {
                margin-left: 3px;
                margin-bottom: 5px;
            }
        }
    }
}

.select {
    color: #10f7ff;
}
.arrow-left {
    width: 25px;
    height: 25px;
    position: absolute;
    left: -5px;
    top: -5px;
}
.arrow-right {
    width: 25px;
    height: 25px;
    position: absolute;
    right: -5px;
    bottom: -5px;
}
.content {
    height: 520px;
    padding-top: 20px;
    padding-bottom: 20px;
    // border: 1px dashed green;
    .left {
        height: 100%;
        width: 55%;
        float: left;
        /*border-rignt: 1px dashed green;*/
        display: flex;

        .left-l {
            width: 100px;
            /*border: 1px dashed red;*/
            height: 100%;

            .iconcontent {
                width: 100%;
                height: 100%;
                // border: 1px solid red;
                text-align: center;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                align-items: center;
                cursor: pointer;

                .menuicon {
                    height: 84px;
                    width: 74px;
                    // border: 1px dashed green;
                    text-align: center;
                    position: relative;
                    padding-top: 10px;

                    .base {
                        width: 50px;
                        height: 50px;
                        position: absolute;
                        left: 50%;
                        transform: translate(-50%, 0);
                    }

                    .iconx {
                        // width: 50px;
                        // height: 50px;
                        position: absolute;
                        top: 34px;
                        left: 50%;
                        transform: translate(-50%, -12px);
                    }

                    .menuicontitle {
                        font-size: 14px;
                        font-weight: 600;
                        /*#02f6ff*/
                        color: #b5bfcc;
                        position: absolute;
                        bottom: 0;
                        left: 10px;
                    }
                    .menuicontitlea {
                        font-size: 14px;
                        font-weight: 600;
                        /*#02f6ff*/
                        color: #02f6ff;
                        position: absolute;
                        bottom: 0;
                        left: 10px;
                    }
                }
            }
            .menuicon1 {
            }
        }
        .left-r {
            flex: 1;
            height: 480px;
            overflow: hidden;
            overflow-y: auto;

            &::-webkit-scrollbar {
                width: 5px;
                background-color: rgba(7, 48, 74, 0.4);
            }
            &::-webkit-scrollbar-thumb {
                width: 4px;
                background-color: #093f62;
                border-radius: 3px;
            }
            /*border: 1px dashed red;*/
            // padding-left: 20px;
            // padding-right: 20px;
        }
    }
    .right {
        height: 100%;
        width: 45%;
        /*float: left;*/
        /*border: 1px dashed green;*/
        border-left: 2px dashed rgba(7, 48, 74, 0.87);
        display: flex;
        flex-direction: column;

        .right-t {
            height: 168px;
            /*border: 1px dashed red;*/
        }

        .right-b {
            flex: 1;
            /*border: 1px dashed red;*/
            overflow: hidden;
        }
    }

    #imgWenDu {
        position: absolute;
        top: 36px;
        left: 54%;
        transform: translate(-50%, -12px);
    }
}

</style>